public class ListNode {
    
    public int val;
        public ListNode next;

        public ListNode(int val){

            this.val = val;
        }

        public String toString(){

            StringBuilder builder = new StringBuilder();

            builder.append(val);
            builder.append(",");

            ListNode nextNode = next;

            while(null!=nextNode){

                builder.append(nextNode.val);
                builder.append(",");
                nextNode = nextNode.next;
            }
            

            return builder.toString();
        }
}
